package com.nulldev.util.graphics.renderIt.api;

import java.io.File;

import com.nulldev.util.graphics.renderIt.api.core.IIOCallbackEvent;
import com.nulldev.util.graphics.renderIt.api.core.RITFont;
import com.nulldev.util.graphics.renderIt.api.core.RITVisual;
import com.nulldev.util.graphics.renderIt.api.envcaps.renderItOperations;
import com.nulldev.util.graphics.renderIt.api.math.Matrix3f;
import com.nulldev.util.graphics.renderIt.api.math.Matrix4f;
import com.nulldev.util.graphics.renderIt.api.math.Vector2f;
import com.nulldev.util.graphics.renderIt.api.math.Vector3f;
import com.nulldev.util.graphics.renderIt.api.math.Vector4f;
import com.nulldev.util.graphics.renderIt.renderer.global.rColor;
import com.nulldev.util.graphics.renderIt.util.osdep.OSDependentExtensions;
import com.nulldev.util.graphics.renderIt.util.osdep.OSDependentExtensions.OSDEPAndroidBatteryInfo;

public abstract class renderItGraphicsInterface implements renderItConstants {

	public abstract boolean supportsOperations(final renderItOperations operation);

	public abstract renderItOperations[] supportedOperations();

	public abstract Object rit_get(final int RIT_CONSTANT);

	public abstract Object rit_set(final int RIT_CONSTANT, final Object RIT_OBJECT);

	protected void unsupported() {
		throw new UnsupportedOperationException("Unsupported graphics operation!");
	}

	protected <T> T ret_unsupported() {
		throw new UnsupportedOperationException("Unsupported graphics operation!");
	}

	protected void unsupported(final renderItOperations op) {
		throw new UnsupportedOperationException("Missing graphics operation support! (" + op + ")");
	}

	protected <T> T ret_unsupported(final renderItOperations op) {
		throw new UnsupportedOperationException("Missing graphics operation support! (" + op + ")");
	}

	protected void checkValidInt(final int type, final int value) {
		switch (type) {
			case RIT_VALUE_TYPE_Y:
			case RIT_VALUE_TYPE_X: {
				if (value < 0)
					throw new IllegalArgumentException();
				else
					return;
			}
			case RIT_VALUE_TYPE_COLOR_R:
			case RIT_VALUE_TYPE_COLOR_G:
			case RIT_VALUE_TYPE_COLOR_B: {
				if (value < 0 || value > 255)
					throw new IllegalArgumentException();
				else
					return;
			}
			case RIT_VALUE_TYPE_COLOR_RGB: {
				if (value < -16777215 || value > 16777215)
					throw new IllegalArgumentException("Invalid value: " + value);
				else
					return;
			}
			case RIT_VALUE_TYPE_FONT_FORMAT: {
				if (value != RIT_FONT_FORMAT_BITMAP && value != RIT_FONT_FORMAT_OTF && value != RIT_FONT_FORMAT_TTF)
					throw new IllegalArgumentException();
				else
					return;
			}
			case RIT_VALUE_TYPE_RENDER_METHOD_INT: {
				switch (value) {
					case RIT_SWING_PANEL_PAINT:
					case RIT_SWING_PANEL_PAINT_ALL:
					case RIT_SWING_PANEL_REPAINT:
					case RIT_SWING_PANEL_REPAINT_WITHIN_SYNC:
					case RIT_SWING_PANEL_UPDATE:
						return;
					default:
						this.unsupported();
				}
			}
			case RIT_VALUE_TYPE_GL_VECTOR_TYPE: {
				if (value != GL_VECTOR_TYPE_COORD_FLOAT && value != GL_VECTOR_TYPE_COORD_INT && value != GL_VECTOR_TYPE_COORD_DOUBLE
						&& value != GL_VECTOR_TYPE_COORD_SHORT && value != GL_VECTOR_TYPE_COORD_LONG)
					throw new IllegalArgumentException();
				else
					return;
			}
			case RIT_VALUE_TYPE_GL_DIRECTION_TYPE: {
				switch (value) {
					case GL_DIRECTION_TYPE_INV_X:
					case GL_DIRECTION_TYPE_INV_Y:
					case GL_DIRECTION_TYPE_SWING:
					case GL_DIRECTION_TYPE_INV_XY:
					case GL_DIRECTION_TYPE_INV_YX:
						return;
					default:
						this.unsupported();
				}
			}
			case RIT_VALUE_TYPE_GL_VEC_RENDER_TYPE: {
				switch (value) {
					case GL_TYPE_POINTS:
					case GL_TYPE_LINES:
					case GL_TYPE_LINE_STRIP:
					case GL_TYPE_LINE_LOOP:
					case GL_TYPE_TRIANGLES:
					case GL_TYPE_TRIANGLE_STRIP:
					case GL_TYPE_TRIANGLE_FAN:
					case GL_TYPE_QUADS:
					case GL_TYPE_QUAD_STRIP:
					case GL_TYPE_POLYGON:
						return;
					default:
						this.unsupported();
				}
			}
			default:
				throw new UnsupportedOperationException("Unknown validation type: " + type);
		}
	}

	protected void checkValidObject(final int type, final Object value) {
		switch (type) {
			case RIT_VALUE_TYPE_STRING: {
				if (value == null)
					throw new NullPointerException();
				else if (value instanceof String) {
					return;
				} else
					throw new IllegalArgumentException("Invalid type: " + value);
			}
			case RIT_VALUE_TYPE_AWT_FONT_METRICS: {
				if (value == null)
					throw new NullPointerException();
				else if (value instanceof java.awt.FontMetrics) {
					return;
				} else
					throw new IllegalArgumentException("Invalid type: " + value);
			}
			case RIT_VALUE_TYPE_VEC_2F:
				if (value == null)
					throw new NullPointerException();
				else if (value instanceof Vector2f) {
					final Vector2f val = (Vector2f) value;
					if ((val.getX() >= 0.0f && val.getX() <= 1.0f) && (val.getY() >= 0.0f && val.getY() <= 1.0f))
						return;
					else
						throw new IllegalArgumentException("Invalid vector: " + value);
				} else
					throw new IllegalArgumentException("Invalid type: " + value);
			case RIT_VALUE_TYPE_VEC_3F:
				if (value == null)
					throw new NullPointerException();
				else if (value instanceof Vector3f) {
					final Vector3f val = (Vector3f) value;
					if ((val.getX() >= 0.0f && val.getX() <= 1.0f) && (val.getY() >= 0.0f && val.getY() <= 1.0f) && val.getZ() >= 0.0f)
						return;
					else
						throw new IllegalArgumentException("Invalid vector: " + value);
				} else
					throw new IllegalArgumentException("Invalid type: " + value);
			case RIT_VALUE_TYPE_VEC_4F:
				if (value == null)
					throw new NullPointerException();
				else if (value instanceof Vector4f) {
					final Vector4f val = (Vector4f) value;
					if ((val.getX() >= 0.0f && val.getX() <= 1.0f) && (val.getY() >= 0.0f && val.getY() <= 1.0f) && (val.getZ() >= 0.0f && val.getZ() <= 1.0f)
							&& (val.getW() >= 0.0f && val.getW() <= 1.0f))
						return;
					else
						throw new IllegalArgumentException("Invalid vector: " + value);
				} else
					throw new IllegalArgumentException("Invalid type: " + value);
			default:
				throw new UnsupportedOperationException("Unknown validation type: " + type);
		}
	}

	protected void checkValidDouble(final int type, final double value) {
		switch (type) {
			case RIT_VALUE_TYPE_Y:
			case RIT_VALUE_TYPE_X: {
				if (value < 0)
					throw new IllegalArgumentException();
				else
					return;
			}
			case RIT_VALUE_TYPE_COLOR_R:
			case RIT_VALUE_TYPE_COLOR_G:
			case RIT_VALUE_TYPE_COLOR_B:
			case RIT_VALUE_TYPE_COLOR_A: {
				if (value < 0.0d || value > 1.0d)
					throw new IllegalArgumentException();
				else
					return;
			}
			default:
				throw new UnsupportedOperationException("Unknown validation type: " + type);
		}
	}

	/* RIT_EXT_basic_drawing */

	public void bd_drawRect(final int x, final int y, final int w, final int h) {
		this.bd_drawRect(x, y, w, h, null);
	}

	public void bd_drawRect(final int x, final int y, final int w, final int h, final rColor color) {
		this.unsupported(renderItOperations.RIT_EXT_basic_drawing);
	}

	public void bd_fillRect(final int x, final int y, final int w, final int h) {
		this.bd_fillRect(x, y, w, h, null);
	}

	public void bd_fillRect(final int x, final int y, final int w, final int h, final rColor color) {
		this.unsupported(renderItOperations.RIT_EXT_basic_drawing);
	}

	public void bd_putPixel(final int x, final int y) {
		this.bd_putPixel(x, y, null);
	}

	public void bd_putPixel(final int x, final int y, final rColor color) {
		this.unsupported(renderItOperations.RIT_EXT_basic_drawing);
	}

	public void bd_drawLine(final int x1, final int y1, final int x2, final int y2) {
		this.bd_drawLine(x1, y1, x2, y2, null);
	}

	public void bd_drawLine(final int x1, final int y1, final int x2, final int y2, final rColor color) {
		this.unsupported(renderItOperations.RIT_EXT_basic_drawing);
	}

	/* RIT_EXT_viewport_info */

	public int viewport_getWidth() {
		return RIT_NOT_SUPPORTED;
	}

	public int viewport_getHeight() {
		return RIT_NOT_SUPPORTED;
	}

	/* RIT_EXT_viewport_offset */

	public int viewport_getXOffset() {
		return RIT_NOT_SUPPORTED;
	}

	public int viewport_getYOffset() {
		return RIT_NOT_SUPPORTED;
	}

	/* RIT_EXT_viewport_control */

	public boolean viewport_requestSize(final int width, final int height) {
		return false;
	}

	public boolean viewport_requestHeight(final int height) {
		return false;
	}

	public boolean viewport_requestWidth(final int width) {
		return false;
	}

	/* RIT_EXT_basic_shapes */

	public void bd_drawOval(final int x, final int y, final int width, final int height) {
		this.bd_drawOval(x, y, width, height, null);
	}

	public void bd_drawOval(final int x, final int y, final int width, final int height, final rColor color) {
		this.unsupported(renderItOperations.RIT_EXT_basic_shapes);
	}

	public void bd_drawCircle(final int x, final int y, final int r) {
		this.bd_drawCircle(x, y, r, null);
	}

	public void bd_drawCircle(final int x, final int y, final int r, final rColor color) {
		this.unsupported(renderItOperations.RIT_EXT_basic_shapes);
	}

	public void bd_fillOval(final int x, final int y, final int width, final int height) {
		this.bd_fillOval(x, y, width, height, null);
	}

	public void bd_fillOval(final int x, final int y, final int width, final int height, final rColor color) {
		this.unsupported(renderItOperations.RIT_EXT_basic_shapes);
	}

	public void bd_fillCircle(final int x, final int y, final int r) {
		this.bd_fillCircle(x, y, r, null);
	}

	public void bd_fillCircle(final int x, final int y, final int r, final rColor color) {
		this.unsupported(renderItOperations.RIT_EXT_basic_shapes);
	}

	/* RIT_EXT_deferred_rendering */

	public boolean rit_dr_isEnabled() {
		return false;
	}

	public void rit_dr_setEnabled(final boolean state) {
		this.unsupported(renderItOperations.RIT_EXT_deferred_rendering);
	}

	public void rit_dr_requestPaint() {
	}

	/* RIT_EXT_color */

	public rColor getColor() {
		return null;
	}

	public void setColor(final rColor color) {
		this.unsupported(renderItOperations.RIT_EXT_color);
	}

	public void setColor(final int color) {
		this.unsupported(renderItOperations.RIT_EXT_color);
	}

	public void setColor(final int r, final int g, final int b) {
		this.unsupported(renderItOperations.RIT_EXT_color);
	}

	public void setColor(final double r, final double g, final double b, final double a) {
		this.unsupported(renderItOperations.RIT_EXT_color);
	}

	/* RIT_EXT_versions */

	public String rit_version() {
		return renderItAPI.VERSION.asVersionString();
	}

	public String backend_version() {
		return String.valueOf(RIT_NOT_SUPPORTED);
	}

	/* RIT_WM_window_position */

	public void wm_setWindowPosX(final int x) {
		this.unsupported(renderItOperations.RIT_WM_window_position);
	}

	public void wm_setWindowPosY(final int y) {
		this.unsupported(renderItOperations.RIT_WM_window_position);
	}

	public int wm_getPosX() {
		return RIT_NOT_SUPPORTED;
	}

	public int wm_getPosY() {
		return RIT_NOT_SUPPORTED;
	}

	/* RIT_WM_window */

	public String wm_getTitle() {
		return null;
	}

	public void wm_setTitle(final String title) {
		this.unsupported(renderItOperations.RIT_WM_window);
	}

	public void wm_setWidth(final int width) {
		this.unsupported(renderItOperations.RIT_WM_window);
	}

	public void wm_setHeight(final int height) {
		this.unsupported(renderItOperations.RIT_WM_window);
	}

	public int wm_getWidth() {
		return RIT_NOT_SUPPORTED;
	}

	public int wm_getHeight() {
		return RIT_NOT_SUPPORTED;
	}

	public boolean wm_isFullScreen() {
		return false;
	}

	/* RIT_SWING_panel_control */

	public void swing_panel_doubleBuffer(final boolean doubleBuffer) {
		this.unsupported(renderItOperations.RIT_SWING_panel_control);
	}

	public boolean swing_panel_isDoubleBuffered() {
		return false;
	}

	public void swing_panel_setSize(final int width, final int height) {
		this.unsupported(renderItOperations.RIT_SWING_panel_control);
	}

	public int swing_panel_getSizeX() {
		return RIT_NOT_SUPPORTED;
	}

	public int swing_panel_getSizeY() {
		return RIT_NOT_SUPPORTED;
	}

	/* RIT_SWING_image_draw */

	public void swing_drawImage(final Object image, final int x, final int y) {
		this.unsupported(renderItOperations.RIT_SWING_image_draw);
	}

	public void swing_drawImage(final Object image, final int x, final int y, final int width, final int height) {
		this.unsupported(renderItOperations.RIT_SWING_image_draw);
	}

	public void swing_drawImage(final Object image, final int x, final int y, final int width, final int height, final Object observer) {
		this.unsupported(renderItOperations.RIT_SWING_image_draw);
	}

	/* RIT_SWING_text_width */

	public int swing_textWidth(final String text) {
		return this.ret_unsupported(renderItOperations.RIT_SWING_text_width);
	}

	/* RIT_nullutil_swing_api */

	public void nullutil_swing_center() {
		this.unsupported(renderItOperations.RIT_nullutil_swing_api);
	}

	public int nullutil_swing_getRefreshRate() {
		return RIT_NOT_SUPPORTED;
	}

	public int nullutil_swing_stringWidth(final Object fontMetrics, final String line) {
		return RIT_NOT_SUPPORTED;
	}

	public boolean nullutil_swing_isUsingHWAccel() {
		return false;
	}

	/* RIT_canvas_clear */

	public void canvas_clear(final int x, final int y, final int width, final int height) {
		this.canvas_clear(x, y, width, height, null);
	}

	public void canvas_clear(final int x, final int y, final int width, final int height, final rColor color) {
		this.unsupported(renderItOperations.RIT_canvas_clear);
	}

	public void canvas_clear(final Vector4f v4f) {
		this.canvas_clear(v4f, null);
	}

	public void canvas_clear(final Vector4f v4f, final rColor color) {
		this.unsupported(renderItOperations.RIT_canvas_clear);
	}

	public void canvas_clear(final Vector2f pos, final Vector2f dim) {
		this.canvas_clear(pos, dim, null);
	}

	public void canvas_clear(final Vector2f pos, final Vector2f dim, final rColor color) {
		this.unsupported(renderItOperations.RIT_canvas_clear);
	}

	/* RIT_SWING_render_method */

	public int swing_getRenderMethod() {
		return RIT_NOT_SUPPORTED;
	}

	public void swing_setRenderMethod(final int renderMethod) {
		this.unsupported(renderItOperations.RIT_SWING_render_method);
	}

	public boolean swing_supportsRenderMethod(final int renderMethod) {
		return false;
	}

	/* RIT_AWT_render_method */

	public int awt_getRenderMethod() {
		return RIT_NOT_SUPPORTED;
	}

	public void awt_setRenderMethod(final int renderMethod) {
		this.unsupported(renderItOperations.RIT_AWT_render_method);
	}

	public boolean awt_supportsRenderMethod(final int renderMethod) {
		return false;
	}

	/* RIT_AWT_panel_control */

	public void awt_panel_setSize(final int width, final int height) {
		this.unsupported(renderItOperations.RIT_AWT_panel_control);
	}

	public int awt_panel_getSizeX() {
		return RIT_NOT_SUPPORTED;
	}

	public int awt_panel_getSizeY() {
		return RIT_NOT_SUPPORTED;
	}

	/* RIT_font_file_formats */

	public boolean supportsFontFileFormat(final int fontFormat) {
		this.checkValidInt(RIT_VALUE_TYPE_FONT_FORMAT, fontFormat);
		return false;
	}

	/* NITROUS_accel_info */

	public String nitrous_getBackend() {
		return null;
	}

	/* RIT_2D_matrix and RIT_2D_vector */

	public Matrix3f createMatrix2f(final float x, final float y) {
		return new Matrix3f(x, 0, 0, y, 0, 0, 0, 0, 0);
	}

	public Vector2f createVector2f(final float x, final float y) {
		return new Vector2f(x, y);
	}

	/* RIT_3D_matrix and RIT_3D_vector */

	public Matrix3f createMatrix3f(final float x, final float y, final float z) {
		return new Matrix3f(x, 0, 0, y, 0, 0, z, 0, 0);
	}

	public Matrix3f createMatrix3f(final float x1, final float x2, final float x3, final float y1, final float y2, final float y3, final float z1,
			final float z2, final float z3) {
		return new Matrix3f(x1, x2, x3, y1, y2, y3, z1, z2, z3);
	}

	public Matrix4f createMatrix4f(final float x, final float y, final float z, final float w) {
		return new Matrix4f(x, 0, 0, 0, y, 0, 0, 0, z, 0, 0, 0, w, 0, 0, 0);
	}

	public Matrix4f createMatrix4f(final float x1, final float x2, final float x3, final float x4, final float y1, final float y2, final float y3,
			final float y4, final float z1, final float z2, final float z3, final float z4, final float w1, final float w2, final float w3, final float w4) {
		return new Matrix4f(x1, x2, x3, x4, y1, y2, y3, y4, z1, z2, z3, z4, w1, w2, w3, w4);
	}

	public Vector3f createVector3f(final float x, final float y, final float z) {
		return new Vector3f(x, y, z);
	}

	public Vector4f createVector4f(final float x, final float y, final float z, final float w) {
		return new Vector4f(x, y, z, w);
	}

	/* RIT_2D_basic_drawing */

	public void rit_2d_drawPoint(final Vector2f vec) {
		this.unsupported(renderItOperations.RIT_2D_basic_drawing);
	}

	public void rit_2d_drawLine(final Vector2f start, final Vector2f end) {
		this.unsupported(renderItOperations.RIT_2D_basic_drawing);
	}

	public void rit_2d_drawLine(final Vector4f loc) {
		this.rit_2d_drawLine(new Vector2f(loc.getX(), loc.getY()), new Vector2f(loc.getZ(), loc.getW()));
	}

	public void rit_2d_drawRect(final Vector2f pos, final int width, final int height) {
		this.unsupported(renderItOperations.RIT_2D_basic_drawing);
	}

	public void rit_2d_drawRect(final Vector2f pos, final Vector2f dim) {
		this.unsupported(renderItOperations.RIT_2D_basic_drawing);
	}

	public void rit_2d_drawRect(final Vector4f rect) {
		this.checkValidObject(RIT_VALUE_TYPE_VEC_4F, rect);
		this.rit_2d_drawRect(new Vector2f(rect.getX(), rect.getY()), new Vector2f(rect.getZ(), rect.getW()));
	}

	public void rit_2d_fillRect(final Vector2f pos, final int width, final int height) {
		this.unsupported(renderItOperations.RIT_2D_basic_drawing);
	}

	public void rit_2d_fillRect(final Vector2f pos, final Vector2f dim) {
		this.unsupported(renderItOperations.RIT_2D_basic_drawing);
	}

	public void rit_2d_fillRect(final Vector4f rect) {
		this.checkValidObject(RIT_VALUE_TYPE_VEC_4F, rect);
		this.rit_2d_fillRect(new Vector2f(rect.getX(), rect.getY()), new Vector2f(rect.getZ(), rect.getW()));
	}

	/* RIT_3D_psuedo_basic_drawing */

	public void rit_3d_draw_hRect(final Vector4f rect, final boolean raise) {
		this.unsupported(renderItOperations.RIT_3D_psuedo_basic_drawing);
	}

	public void rit_3d_draw_hRect(final Vector2f pos, final Vector2f rect, final boolean raise) {
		this.checkValidObject(RIT_VALUE_TYPE_VEC_2F, pos);
		this.checkValidObject(RIT_VALUE_TYPE_VEC_2F, rect);
		this.rit_3d_draw_hRect(new Vector4f(pos, rect.getX(), rect.getY()), raise);
	}

	public void rit_3d_draw_hRect(final Vector2f pos, final int width, final int height, final boolean raise) {
		this.unsupported(renderItOperations.RIT_3D_psuedo_basic_drawing);
	}

	public void rit_3d_fill_hRect(final Vector4f rect, final boolean raise) {
		this.unsupported(renderItOperations.RIT_3D_psuedo_basic_drawing);
	}

	public void rit_3d_fill_hRect(final Vector2f pos, final Vector2f rect, final boolean raise) {
		this.checkValidObject(RIT_VALUE_TYPE_VEC_2F, pos);
		this.checkValidObject(RIT_VALUE_TYPE_VEC_2F, rect);
		this.rit_3d_fill_hRect(new Vector4f(pos, rect.getX(), rect.getY()), raise);
	}

	public void rit_3d_fill_hRect(final Vector2f pos, final int width, final int height, final boolean raise) {
		this.unsupported(renderItOperations.RIT_3D_psuedo_basic_drawing);
	}

	/* GL_compat_vertex */

	public void glVertex2f(final float x, final float y) {
		this.unsupported(renderItOperations.GL_compat_vertex);
	}

	public void glVertex2i(final int x, final int y) {
		this.unsupported(renderItOperations.GL_compat_vertex);
	}

	public void glVertex2d(final double x, final double y) {
		this.unsupported(renderItOperations.GL_compat_vertex);
	}

	public void glVertex2s(final short x, final short y) {
		this.unsupported(renderItOperations.GL_compat_vertex);
	}

	/* GL_compat_3d_vertex */

	public void glVertex3f(final float x, final float y, final float z) {
		this.unsupported(renderItOperations.GL_compat_3d_vertex);
	}

	public void glVertex3i(final int x, final int y, final int z) {
		this.unsupported(renderItOperations.GL_compat_3d_vertex);
	}

	public void glVertex3d(final double x, final double y, final double z) {
		this.unsupported(renderItOperations.GL_compat_3d_vertex);
	}

	public void glVertex3s(final short x, final short y, final short z) {
		this.unsupported(renderItOperations.GL_compat_3d_vertex);
	}

	public void glVertex4f(final float x, final float y, final float z, final float w) {
		this.unsupported(renderItOperations.GL_compat_3d_vertex);
	}

	public void glVertex4i(final int x, final int y, final int z, final int w) {
		this.unsupported(renderItOperations.GL_compat_3d_vertex);
	}

	public void glVertex4d(final double x, final double y, final double z, final double w) {
		this.unsupported(renderItOperations.GL_compat_3d_vertex);
	}

	public void glVertex4s(final short x, final short y, final short z, final short w) {
		this.unsupported(renderItOperations.GL_compat_3d_vertex);
	}

	/* GL_compat_vectors */

	public void glTreatVectorsAs(final int type) {
		this.unsupported(renderItOperations.GL_compat_vectors);
	}

	public int glGetVectorTreatment() {
		return RIT_NOT_SUPPORTED;
	}

	/* GL_compat_direction */

	public int glCompatGetDirection() {
		return RIT_NOT_SUPPORTED;
	}

	public void glCompatSetDirection(final int type) {
		this.unsupported(renderItOperations.GL_compat_direction);
	}

	/* GL_render_control */

	public void glBegin(final int type) {
		this.unsupported(renderItOperations.GL_render_control);
	}

	public void glEnd(final int type) {
		this.unsupported(renderItOperations.GL_render_control);
	}

	/* GL_clear_color */

	public int gl_getClearColor() {
		return RIT_NOT_SUPPORTED;
	}

	public void gl_setClearColor(final int color) {
		this.unsupported(renderItOperations.GL_clear_color);
	}

	public void gl_setClearColor(final int r, final int g, final int b) {
		this.unsupported(renderItOperations.GL_clear_color);
	}

	public void gl_setClearColor(final double r, final double g, final double b, final double a) {
		this.unsupported(renderItOperations.GL_clear_color);
	}

	/* GL_sync_impl */

	public int gl_getSyncImpl() {
		return RIT_NOT_SUPPORTED;
	}

	public void gl_syncImpl(final int type) {
		this.unsupported(renderItOperations.GL_sync_impl);
	}

	/* GL_sync_to_blank */

	public void gl_syncToBlank(final int interval) {
		this.unsupported(renderItOperations.GL_sync_to_blank);
	}

	/* GL_renderer_info */

	public String gl_getModel() {
		return null;
	}

	public String gl_getVendor() {
		return null;
	}

	public String gl_getVersion() {
		return null;
	}

	/* RIT_RIO_closable */

	public void closeOperations() {
	}

	/* RIT_font_create */

	public RITFont font_create(final String name, final int size, final int style) {
		return this.ret_unsupported(renderItOperations.RIT_font_create);
	}

	public RITFont font_create(final String name, final float size, final int style) {
		return this.ret_unsupported(renderItOperations.RIT_font_create);
	}

	public RITFont font_create(final String name, final int size) {
		return this.ret_unsupported(renderItOperations.RIT_font_create);
	}

	public RITFont font_create(final String name, final float size) {
		return this.ret_unsupported(renderItOperations.RIT_font_create);
	}

	public RITFont font_create(final File file) {
		return this.ret_unsupported(renderItOperations.RIT_font_create);
	}

	/* RIT_font_ops */

	public void font_destroy(final RITFont font) {
		this.unsupported(renderItOperations.RIT_font_ops);
	}

	public int font_get_format(final RITFont font) {
		return RIT_NOT_SUPPORTED;
	}

	public RITFont font_clone(final RITFont font, final int size, final int style) {
		return this.ret_unsupported(renderItOperations.RIT_font_ops);
	}

	public RITFont font_clone(final RITFont font, final float size, final int style) {
		return this.ret_unsupported(renderItOperations.RIT_font_ops);
	}

	public RITFont font_clone(final RITFont font, final int size) {
		return this.ret_unsupported(renderItOperations.RIT_font_ops);
	}

	public RITFont font_clone(final RITFont font, final float size) {
		return this.ret_unsupported(renderItOperations.RIT_font_ops);
	}

	/* RIT_text_string */

	public void text_string(final String text, final int x, final int y, final RITFont font) {
		this.text_string(text, x, y, font, null);
	}

	public void text_string(final String text, final int x, final int y, final RITFont font, final rColor color) {
		this.unsupported(renderItOperations.RIT_text_string);
	}

	public void text_shadowedString(final String text, final int x, final int y, final RITFont font) {
		this.text_string(text, x, y, font, null);
	}

	public void text_shadowedString(final String text, final int x, final int y, final RITFont font, final rColor color) {
		this.unsupported(renderItOperations.RIT_text_string);
	}

	/* RIT_text_string_scalable */

	public int text_scalable(final String text, final int x, final int y, final RITFont font) {
		return this.text_scalable(text, x, y, font, null);
	}

	public int text_scalable(final String text, final int x, final int y, final RITFont font, final rColor color) {
		return this.ret_unsupported(renderItOperations.RIT_text_string_scalable);
	}

	/* RIT_text_string_scalable_offset */

	public int text_scalable(final String text, final int x, final int y, final int offset, final RITFont font) {
		return this.text_scalable(text, x, y, font, null);
	}

	public int text_scalable(final String text, final int x, final int y, final int offset, final RITFont font, final rColor color) {
		return this.ret_unsupported(renderItOperations.RIT_text_string_scalable_offset);
	}

	/* RIT_text_anti_aliasing */

	public boolean text_isAAPresent() {
		return false;
	}

	public void text_setAAPresence(final boolean value) {
		this.unsupported(renderItOperations.RIT_text_anti_aliasing);
	}

	/* RIT_EXT_buffer_control */

	public int rit_buffer_getType() {
		return RIT_NOT_SUPPORTED;
	}

	public void rit_buffer_setType(final int type) {
		this.unsupported(renderItOperations.RIT_EXT_buffer_control);
	}

	/* RIT_AWT_current_font */

	public Object awt_getCurrentFont() {
		return this.ret_unsupported(renderItOperations.RIT_AWT_current_font);
	}

	/* RIT_AWT_font_conversion */

	public RITFont awt_make_font(final Object font) {
		return this.ret_unsupported(renderItOperations.RIT_AWT_font_conversion);
	}

	/* RIT_AWT_font_metrics */

	public Object awt_getFontMetrics(final RITFont font) {
		return this.ret_unsupported(renderItOperations.RIT_AWT_font_metrics);
	}

	/* RIT_AWT_has_renderable */

	public boolean awt_hasRenderable() {
		return true;
	}

	/* RIT_AWT_text_width */

	public int awt_textWidth(final String text) {
		return this.ret_unsupported(renderItOperations.RIT_AWT_text_width);
	}

	/* RIT_EXT_vsync */

	public void vsync_syncToDisplay(final int display) {
		this.unsupported(renderItOperations.RIT_EXT_vsync);
	}

	public boolean vsync_isEnabled() {
		return true;
	}

	public boolean vsync_supportsAdaptiveSync() {
		return false;
	}

	public void vsync_set(final int value) {
		this.unsupported(renderItOperations.RIT_EXT_vsync);
	}

	/* RIT_media_drawable_vsurface */

	public void media_importSurface(final Object obj, final int x, final int y, final int width, final int height) {
		this.unsupported(renderItOperations.RIT_media_drawable_vsurface);
	}

	/* RIT_visuals_main */

	public RITVisual visuals_get_current() {
		return RITVisual.STUB;
	}

	/* RIT_canvas_copy_area */

	public void canvas_copyArea(final int x, final int y, final int width, final int height, final int destX, final int destY) {
		this.unsupported(renderItOperations.RIT_canvas_copy_area);
	}

	////////////////////////////

	/* LINUX_environment_info */

	public String linux_get_version() {
		return OSDependentExtensions.os_linux_get_version();
	}

	public String linux_get_distro() {
		return OSDependentExtensions.os_linux_get_distro();
	}

	/* ANDROID_battery_info */

	public boolean android_battery_isSavingActive() {
		return android_battery_isSavingActive(null);
	}

	public boolean android_battery_isSavingActive(final Object context) {
		final OSDEPAndroidBatteryInfo abi = OSDependentExtensions.android_get_battery_info(context);
		return abi.isBatterySaving;
	}

	public float android_battery_getValue() {
		return android_battery_getValue(null);
	}

	public float android_battery_getValue(final Object context) {
		final OSDEPAndroidBatteryInfo abi = OSDependentExtensions.android_get_battery_info(context);
		return abi.batteryPercentage;
	}

	public boolean android_battery_isCharging() {
		return android_battery_isCharging(null);
	}

	public boolean android_battery_isCharging(final Object context) {
		final OSDEPAndroidBatteryInfo abi = OSDependentExtensions.android_get_battery_info(context);
		return abi.isCharging;
	}

	public boolean android_battery_isLowPower() {
		return android_battery_isLowPower(null);
	}

	public boolean android_battery_isLowPower(final Object context) {
		final OSDEPAndroidBatteryInfo abi = OSDependentExtensions.android_get_battery_info(context);
		return abi.isLowPower;
	}

	/* WINDOWS_invalidate_surface */

	public void windows_invalidateSurface() {
		this.unsupported(renderItOperations.WINDOWS_invalidate_surface);
	}

	/* TOOLKIT_pipeline_flush */

	public void toolkit_flushPipeline() {
	}

	/* RIT_LCDUI_grayscale */

	public boolean lcdui_isGrayscale() {
		return false;
	}

	public void lcdui_setGrayscale(final int amount) {
		this.unsupported(renderItOperations.RIT_LCDUI_grayscale);
	}

	public int lcdui_getGrayscale() {
		return this.ret_unsupported(renderItOperations.RIT_LCDUI_grayscale);
	}

	/* RIT_LCDUI_rgb */

	public int lcdui_getRed() {
		return this.ret_unsupported(renderItOperations.RIT_LCDUI_rgb);
	}

	public void lcdui_setRed(final int amount) {
		this.unsupported(renderItOperations.RIT_LCDUI_rgb);
	}

	public int lcdui_getBlue() {
		return this.ret_unsupported(renderItOperations.RIT_LCDUI_rgb);
	}

	public void lcdui_setBlue(final int amount) {
		this.unsupported(renderItOperations.RIT_LCDUI_rgb);
	}

	public int lcdui_getGreen() {
		return this.ret_unsupported(renderItOperations.RIT_LCDUI_rgb);
	}

	public void lcdui_setGreen(final int amount) {
		this.unsupported(renderItOperations.RIT_LCDUI_rgb);
	}

	/* RIT_LCDUI_redraw_serial */

	public void lcdui_redraw_serially() {
		this.unsupported(renderItOperations.RIT_LCDUI_redraw_serial);
	}

	/* RIT_LCDUI_region */

	public void lcdui_drawRegion(final Object image, final int x_src, final int y_src, final int width, final int height, final int transform, final int x_dest,
			final int y_dest, final int anchor) {
		this.unsupported(renderItOperations.RIT_LCDUI_region);
	}

	/* RIT_LCDUI_clip */

	public int lcdui_clip_getHeight() {
		return RIT_NOT_SUPPORTED;
	}

	public int lcdui_clip_getWidth() {
		return RIT_NOT_SUPPORTED;
	}

	public int lcdui_clip_getX() {
		return RIT_NOT_SUPPORTED;
	}

	public int lcdui_clip_getY() {
		return RIT_NOT_SUPPORTED;
	}

	public void lcdui_clip_set(final int x, final int y, final int width, final int height) {
		this.unsupported(renderItOperations.RIT_LCDUI_clip);
	}

	public void lcdui_clip_rect(final int x, final int y, final int width, final int height) {
		this.unsupported(renderItOperations.RIT_LCDUI_clip);
	}

	/* RIT_LCDUI_text_substring */

	public void lcdui_drawSubstring(final String str, final int offset, final int length, final int x, final int y, final int anchor) {
		this.lcdui_drawSubstring(str, offset, length, x, y, anchor, null, null);
	}

	public void lcdui_drawSubstring(final String str, final int offset, final int length, final int x, final int y, final int anchor, final rColor color) {
		this.lcdui_drawSubstring(str, offset, length, x, y, anchor, null, color);
	}

	public void lcdui_drawSubstring(final String str, final int offset, final int length, final int x, final int y, final int anchor, final RITFont font) {
		this.lcdui_drawSubstring(str, offset, length, x, y, anchor, font, null);
	}

	public void lcdui_drawSubstring(final String str, final int offset, final int length, final int x, final int y, final int anchor, final RITFont font,
			final rColor color) {
		this.unsupported(renderItOperations.RIT_LCDUI_text_substring);
	}

	/* RIT_IO_input_events */

	public boolean rit_io_input_events_register_listener(final IIOCallbackEvent callback, final int type) {
		return false;
	}

	public boolean rit_io_input_events_remove_listener(final IIOCallbackEvent callback) {
		return rit_io_input_events_remove_listener(callback, -1);
	}

	public boolean rit_io_input_events_remove_listener(final IIOCallbackEvent callback, final int type) {
		return false;
	}

	public boolean rit_io_input_events_is_registered(final IIOCallbackEvent callback, final int type) {
		return false;
	}

	public boolean rit_io_input_events_supports_type(final int type) {
		return false;
	}

	/* RIT_IO_keyboard_input */

	public int rit_io_keyboard_get_key() {
		return this.ret_unsupported(renderItOperations.RIT_IO_keyboard_input);
	}

	/* RIT_IO_keyboard_output */

	public boolean rit_io_keyboard_send_key(final int key) {
		return this.ret_unsupported(renderItOperations.RIT_IO_keyboard_output);
	}

	/* RIT_IO_mouse_input */

	public int rit_io_mouse_get_key() {
		return this.ret_unsupported(renderItOperations.RIT_IO_mouse_input);
	}

	/* RIT_IO_mouse_output */

	public boolean rit_io_mouse_send_key(final int key) {
		return this.ret_unsupported(renderItOperations.RIT_IO_mouse_output);
	}
}